Fast recovery method and device for STP-based backup port

ABSTRACT

Disclosed is a fast recovery method for a Spanning Tree Protocol (STP) based backup port, and the method includes: it is detected that a failure occurs on a port of an STP-based device; and it is determined whether there is a backup port taking a failed port as a master port, and when it is determined that there is such a backup port, said backup port is changed to a master port; further disclosed is a fast recovery device for an STP based backup port. By means of the technical solutions of the disclosure, it is possible to shorten significantly recovery time of a backup port, and improve greatly performance of link recovery.

TECHNICAL FIELD

The disclosure relates to the technical field of communications, and inparticular to a fast recovery method and device for a Spanning TreeProtocol (STP) based backup port.

BACKGROUND

At present, with the popularity of networks, users have increasing highrequirements on reliability of networks, thus for important networkconnections, it is a commonly used method to provide backup links.

In a two-layer network, provision of backups for important networkconnections results in a loop in physical connections of the network,thereby leading to a broadcast storm, and a Spanning Tree Protocol (STP)is used to eliminate the loop in the two-layer network.

The topology of a whole network is shaped in a tree-shaped structurethrough blocking of redundant links by the STP so that there is only onelink between any two points during communication, avoiding generation ofa broadcast storm; and when a failure occurs on a link, blockedredundant links can be automatically recovered and used for forwarding,thus achieving the purpose of link backup.

In the prior art, when a failure occurs on a master port indirectlyconnected with a backup port (there are other devices connectedtherebetween, messages of a Bridge Protocol Data Unit (BPDU) aretransmitted through these devices), no relevant fast recovery mechanismhas been established in corresponding standards, what can be done isonly to wait until message information of the backup reaches its maximumage (Maxage).

For example, as shown in FIG. 1 that shows a typical applicationscenario when a backup port is taken as a link backup, a Customer Edge(CE) device is connected with different Provider Edge (PE) devices, anda Rapid Spanning Tree Protocol (RSTP) or a Multiple Spanning TreeProtocol (MSTP) runs on the CE device, PE 1 and PE 2 receive STP BPDUmessages, the BPDU messages are transmitted between provider networksthrough Pseudo Wires (PWs), thus achieving an effect as if port 1 andport 2 of the CE device are directly connected; when the network isnormal, port 2 serves as a backup port and is in a blocked state.

When the master port of the CE device, i.e., port 1 fails, port 2serving as a backup port cannot detect the failure and can only waituntil BPDU message information reaches its maxage, then only after twicetime of forward delays, port 2 can forward, thus time taken for portrecovery is about 50 s, and it is not acceptable for network users tosuffer disconnection of that long.

SUMMARY

In view of the above, embodiments of the disclosure are intended toprovide a fast recovery method and device for an STP-based backup portso as to solve the problem in the prior art that port recovery can beperformed only after waiting until message information of the backupport reaches its maxage and the recovery time is relatively long.

The main purpose of the embodiments of the disclosure is achievedthrough below technical solutions.

A fast recovery method for an STP-based backup port, including:

it is detected that a failure occurs on a port of an STP-based device;and it is determined whether there is a backup port taking a failed portas a master port, and when it is determined that there is such a backupport, said backup port is changed to a master port.

In the above solution, the method may further include: after said backupport is changed to a master port, the state of the master port is set toa forwarding state.

In the above solution, the method may include:

when it is detected that a failure occurs on a port of an STP-baseddevice, a port Identity (ID) of a failed port is recorded.

In the above solution, the step that it is determined whether there is abackup port taking a failed port as a master port may include:

it is determined whether in a port priority vector there is a porthaving a specified port field, i.e., port ID that is the same as the IDof the failed port, and when it is determined that there is such a port,said port is determined as the backup port taking the failed port as amaster port.

In the above solution, the method may include:

it is determined whether there is one or multiple backup ports takingthe failed port as a master port; and

when it is determined that there are multiple such backup ports, abackup port having a highest priority is selected as a backup port ofthe failed port.

The embodiments of the disclosure further provide A fast recovery devicefor an STP-based backup port, and the device include:

a detection unit configured to, when detecting that a failure occurs ona port of an STP-based device, trigger a determination unit;

the determination unit configured to determine whether there is a backupport taking a failed port as a master port, and when it is determinedthat there is such a backup port, trigger a processing unit; and

the processing unit configured to change said backup port to a masterport.

In the above solution, the processing unit is further configured to,after said backup port is changed to a master port, set the state of themaster port to a forwarding state.

In the above solution, the detection unit is configured to, when it isdetected that a failure occurs on a port of an STP-based device, recorda port Identity (ID) of the failed port

In the above solution, the determination unit may be configured to:

determine whether in a port priority vector there is a port having aspecified port field, i.e., port ID that is the same as the ID of thefailed port, and when it is determined that there is such a port,determine said port as the backup port taking the failed port as amaster port and trigger the processing unit.

In the above solution, the determination unit may be further configuredto determine whether there is one or multiple backup ports taking thefailed port as a master port, and

when it is determined that there are multiple such backup ports, selecta backup port having a highest priority as a backup port of the failedport and trigger the processing unit.

Beneficial effects of embodiments of the disclosure are as follows.

The embodiments of the disclosure can shorten significantly recoverytime of a backup port, and improve greatly performance of link recovery.

Other features and advantages of the embodiments of the disclosure willbe described later in the specification, and will become partiallyobvious from the specification or be understood through implementationof the embodiments. Objectives and other advantages of the embodimentsof the disclosure are implemented and reached through structuresspecified in particular in the specification, claims and accompanyingdrawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic diagram showing a typical application scenariowhen a backup port is taken as a link backup;

FIG. 2 is a flow chart of a fast recovery method for an STP-based backupport according to an embodiment of the disclosure;

FIG. 3 is a schematic diagram showing a specific embodiment of a fastrecovery method for an STP-based backup port; and

FIG. 4 is a schematic structural diagram of a fast recovery device foran STP-based backup port according to an embodiment of the disclosure.

DETAILED DESCRIPTION

Preferred embodiments of the disclosure will be described below withreference to accompanying drawings, the drawings consist part of thepresent application and are used together with embodiments of thedisclosure to explain the principle of the disclosure. It should beunderstood that the specific embodiments are only used to interpret thedisclosure instead of limiting the disclosure. It should be noted thatembodiments of the disclosure and features in the embodiments can becombined with each other in case of no conflicts.

Firstly, the fast recovery method for an STP-based backup port accordingto an embodiment of the disclosure will be elaborated with reference toFIGS. 1 to 3.

As shown in FIG. 2 that is a flow chart of a fast recovery method for anSTP-based backup port according to the embodiment of the disclosure, themethod specifically includes the following steps:

step 201, an STP-based device detects that a failure occurs on a port ofthe device; and

step 202, it is determined whether there is a backup port taking afailed port as a master port, and when it is determined that there issuch a backup port, said backup port is changed to a master port.

The embodiment takes a scenario shown in FIG. 1 as an example, where anCE is to connected with different PEs, the CE runs the RSTP or MSTP.

As shown in FIG. 3 that is a schematic diagram showing a specificembodiment of a fast recovery method for an STP-based backup port, themethod may specifically include:

step 301, the CE detects that port 1 of a device fails, and records aport identity (port_ID) of the port;

step 302, the port failure results in re-calculation of spanning tree;

step 303, respective ports of the CE are traversed to determine whetherthere is a backup port taking the failed port 1 as a master port,specifically, it is determined whether in a port priority vector thereis a port having a specified port field, i.e., port_ID that is the sameas the port_ID recorded in step 301, if there is, the port having thesame port_ID as the port_ID recorded in step 301 is determined as thebackup port taking the failed port 1 as a master port, then proceed tostep 304; if there is not such a port, proceed to step 307;

step 304, the number of backup ports taking the failed port 1 as amaster port is acquired to determine whether there is one or multiplesuch backup ports, if there are multiple, proceed to step 305,otherwise, proceed to step 306;

step 305, when there are multiple backup ports taking the failed port 1as a master port, then a port having a highest priority is selected,according to a priority rule in the port priority vector, as a backupport of the failed port 1;

step 306, the only backup port determined in step 304 or the backup porthaving a highest priority selected in step 305 is changed to a specifiedport, i.e., the original backup port is specified as master port, andthe state of the master port is set to a forwarding state; and

step 307, the process ends.

It should be noted that the above embodiment of the method is describedonly in a networking environment where a CE is dual homed to PEs, andthe fast recovery mechanism of the backup port is also applied to fastrecovery scenario that takes other ports as a backup. For example, ascenario where a hub or a switch having an STP message transmissionfunction is used to connect indirectly two ports of a switch.

Then, the fast recovery device for an STP-based backup port according toan embodiment of the disclosure will be elaborated with reference toFIG. 4.

As shown in FIG. 4 that is a schematic structural diagram of a fastrecovery device for an STP-based backup port according to an embodimentof the disclosure, the device specifically includes a detection unit 41,a determination unit 42 and a processing unit 43, and respectivefunctional units will be elaborated below.

The detection unit 41 is configured to, when detecting that a failureoccurs on a port of an STP-based device, trigger the determination unit42;

the determination unit 42 is configured to determine whether there is abackup port taking a failed port as a master port, and when it isdetermined that there is such a backup port, trigger the processing unit43;

the processing unit 43 is configured to change said backup port to amaster port; and

the processing unit 43 is further configured to, after said backup portis changed to a master port, set the state of the master port to aforwarding state.

As a preferred embodiment of the disclosure, the detection unit 41 isspecifically configured to, when it is detected that a failure occurs ona port of the STP-based device, record a port ID of the failed port.

The determination unit 42 is specifically configured to traverse portsof the device to perform determination on each port:

specifically, it is determined whether in a port priority vector of thedevice there is a port having a specified port field, i.e., port_ID thatis the same as a recorded port_ID of the failed port, and when it isdetermined that there is such a port, the port having a specified portfield port_ID that is the same as the recorded port ID is determined asa backup port taking the failed port as a master port; and the number ofbackup ports taking the failed port as a master port is acquired;

when it is determined that there is one such backup port, the backupport is determined as the only backup port taking the failed port as amaster port and the processing unit 43 is triggered;

when it is determined that there are multiple such backup ports, thedetermination unit 42 selects a backup port having a highest priority asa backup port of the failed port and triggers the processing unit 43.

In practical applications, the detection unit 41, the determination unit42 and the processing unit 43 can all be implemented by a CentralProcessing unit (CPU), a Digital Signal Processor (DSP) or a FieldProgrammable Gate Array (FPGA); and the CPU, DSP, FPGA are built in anSTP-based device that may be located on the network side.

The specific implementation process of the device according to thedisclosure will be omitted since it has been explained in thedescription of the corresponding method.

To sum up, the embodiments of the disclosure provide a fast recoverymethod and device for an STP-based backup port, it can be seen from thetechnical solutions provided by above embodiments that since a devicereceives message information through a port and the device can detectwhether there is a failure on its port, such information can be used toreduce recovery time of the backup port without leading to a loop; thetechnical solutions provided by the embodiments of the disclosure cansignificantly shorten recovery time of the backup port, and improvegreatly performance of link recovery provided by the backup port duringa link backup scenario.

What described above are merely preferred embodiments of the disclosure,but the scope of protection of the disclosure is not limited thereto,any changes or substitutions easily made by those skilled in the artwithout departing from the technical scope disclosed herein should fallwithin the scope of protection of the disclosure. Therefore, the scopeof protection of the disclosure should be defined as set forth in thefollowing claims.

1. A fast recovery method for a Spanning Tree Protocol (STP) basedbackup port, the method comprising: detecting that a failure occurs on aport of an STP-based device; and determining whether there is a backupport taking a failed port as a master port, and when it is determinedthat there is such a backup port, changing said backup port to a masterport.
 2. The fast recovery method for an STP-based backup port accordingto claim 1, further comprising: after said backup port is changed to amaster port, setting the state of the master port to a forwarding state.3. The fast recovery method for an STP-based backup port according toclaim 1, further comprising: when it is detected that a failure occurson a port of an STP-based device, recording a port Identity (ID) of afailed port.
 4. The fast recovery method for an STP-based backup portaccording to claim 3, wherein the determining whether there is a backupport taking a failed port as a master port comprises: determiningwhether in a port priority vector there is a port having a specifiedport field, i.e., port ID that is the same as the ID of the failed port,and when it is determined that there is such a port, determining saidport as the backup port taking the failed port as a master port.
 5. Thefast recovery method for an STP-based backup port according to claim 1,further comprising: determining whether there is one or multiple backupports taking the failed port as a master port; and when it is determinedthat there are multiple such backup ports, selecting a backup porthaving a highest priority as a backup port of the failed port.
 6. A fastrecovery device for an STP-based backup port, the device comprising: adetection unit configured to, when detecting that a failure occurs on aport of an STP-based device, trigger a determination unit; thedetermination unit configured to determine whether there is a backupport taking a failed port as a master port, and when it is determinedthat there is such a backup port, trigger a processing unit; and theprocessing unit configured to change said backup port to a master port.7. The fast recovery device for an STP-based backup port according toclaim 6, wherein the processing unit is further configured to, aftersaid backup port is changed to a master port, set the state of themaster port to a forwarding state.
 8. The fast recovery device for anSTP-based backup port according to claim 6, wherein the detection unitis further configured to, when detecting that a failure occurs on a portof an STP-based device, record a port Identity (ID) of a failed port. 9.The fast recovery device for an STP-based backup port according to claim8, wherein the determination unit is configured to: determine whether ina port priority vector there is a port having a specified port field,i.e., port ID that is the same as the ID of the failed port, and when itis determined that there is such a port, determine said port as thebackup port taking the failed port as a master port and trigger theprocessing unit.
 10. The fast recovery device for an STP-based backupport according to claim 6, wherein the determination unit is furtherconfigured to determine whether there is one or multiple backup portstaking the failed port as a master port, and when it is determined thatthere are multiple such backup ports, select a backup port having ahighest priority as a backup port of the failed port and trigger theprocessing unit.
 11. The fast recovery method for an STP-based backupport according to claim 2, further comprising: determining whether thereis one or multiple backup ports taking the failed port as a master port;and when it is determined that there are multiple such backup ports,selecting a backup port having a highest priority as a backup port ofthe failed port.
 12. The fast recovery method for an STP-based backupport according to claim 3, further comprising: determining whether thereis one or multiple backup ports taking the failed port as a master port;and when it is determined that there are multiple such backup ports,selecting a backup port having a highest priority as a backup port ofthe failed port.
 13. The fast recovery method for an STP-based backupport according to claim 4, further comprising: determining whether thereis one or multiple backup ports taking the failed port as a master port;and when it is determined that there are multiple such backup ports,selecting a backup port having a highest priority as a backup port ofthe failed port.
 14. The fast recovery device for an STP-based backupport according to claim 7, wherein the determination unit is furtherconfigured to determine whether there is one or multiple backup portstaking the failed port as a master port, and when it is determined thatthere are multiple such backup ports, select a backup port having ahighest priority as a backup port of the failed port and trigger theprocessing unit.
 15. The fast recovery device for an STP-based backupport according to claim 8, wherein the determination unit is furtherconfigured to determine whether there is one or multiple backup portstaking the failed port as a master port, and when it is determined thatthere are multiple such backup ports, select a backup port having ahighest priority as a backup port of the failed port and trigger theprocessing unit.
 16. The fast recovery device for an STP-based backupport according to claim 9, wherein the determination unit is furtherconfigured to determine whether there is one or multiple backup portstaking the failed port as a master port, and when it is determined thatthere are multiple such backup ports, select a backup port having ahighest priority as a backup port of the failed port and trigger theprocessing unit.